﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xinkui.Entity.AutoGenerator;
using Xinkui.DataAccess.AutoGenerator;
using Xinkui.Common;
using Xinkui.DataAccess.User;

namespace Xinkui.WebModel.Cache {
    public static class UserInfoCache {
        public static UserInfo_Entity ViewByCompany(int companyId) {
            return CacheProxy.Get<UserInfo_Entity>(SystemConst.CacheConst.GetUserKey(companyId), () =>
               {
                   return ViewByCompanyFromDb(companyId);
               });
        }

        public static UserInfo_Entity ViewByCompanyFromDb(int companyId) {
            var userInfo = UserDataAccess.UserInfo_ViewByCompany(companyId);
            //TODO:Set Job Title Detail from Dict table
            return userInfo;
        }
    }
}
